import '../../model/skddl.dart';

import '../../model/user.dart';

class SkddlAuthority{

  static bool SdZby(User u1){
       //if(u1.Authority.indexOf("水调值班员")>-1)
       return true;
      // return false;
  }

  static bool DcZby(User u1){
       //if(u1.Authority.indexOf("电厂值班员")>-1)
       //return true;
       
       return false;
  }

  static bool IfQianZi(SKDDL s1, User u1){
       if(!s1.BMIfOK){
          if(s1.BMUserID==u1.Guid){
             return true;
          }
            return false;
       }

       if((!s1.DCIfOK)|| (!s1.GCBIfOK)){
          if(s1.DCUserID==u1.Guid){
             return true;
          }

          if(s1.GCBUserID==u1.Guid){
             return true;
          }
            return false;
       }

       if(!s1.LDIfOK){
          if(s1.LDUserID==u1.Guid){
             return true;
          }
            return false;
       }


     

       return false;

  }


   static String QianZiTitle(SKDDL s1, User u1){
       
      if(s1.BMUserID==u1.Guid){
             return "调度令审核";
       }

        if(s1.DCUserID==u1.Guid){
             return "电厂会签";
       }
 if(s1.GCBUserID==u1.Guid){
             return "工程部会签";
       }

       if(s1.LDUserID==u1.Guid){
             return "调度令签发";
       }

      
      

     

       return "签字版";

  }


  static bool IfQianZi2(SKDDL s1, User u1){
      
       if(s1.State==5 && s1.HZUserID==u1.Guid){
            return true;
       }

       return false;

  }


   static bool IfHuiZhi(SKDDL s1, User u1){

         
      //if(s1.BMIfOK && s1.DCIfOK && s1.GCBIfOK && s1.LDIfOK && DcZby(u1)&&s1.State==3)
      //return true;
      return false;
   }


}